function params = default_params(params)
% params = default_params(params)
% Set default parameters

  % Tolerance on absolute value
  if ~isfield(params,'tol'),
    params.tol = 1e-10;
  end
  
  % Tolerance on relative value
  if ~isfield(params,'vtol'),
    params.vtol = 1e-10;
  end
  
  % Tolerance on relative value
  if ~isfield(params,'grad_tol'),
    params.grad_tol = 1e-3;
  end
  
  % Tolerance on absolute duality gap
  if ~isfield(params,'dg_tol'),
    params.dg_tol = 1e-3;
  end
  
  % Tolerance on relative duality gap
  if ~isfield(params,'dg_vtol'),
    params.dg_vtol = 1e-5;
  end
  
  % Tolerance on (maximum singular value of S - \lambda)
  % S is the dual variable, \lambda is a regularization parameter 
  if ~isfield(params,'smax_tol'),
    params.smax_tol = 1e-4;
  end
  
  % Tolerance on smallest eigenvalue of B
  if ~isfield(params,'vp_tol'),
    params.vp_tol = 1e-4;
  end  
  
  % Verbosity
  if ~isfield(params,'verb'),
    params.verb = true;
  end
  
  if ~isfield(params,'max_iter_tr')
      params.max_iter_tr = 100;
  end
  % Maximum step size during line-search
  if ~isfield(params,'max_step')
    params.max_step = 10;
  end

  % Parameter of the Armijo step
  if ~isfield(params,'sigma_armijo'),
    params.sigma_armijo = 0.5;
  end
  
  % Maximum number of line-search steps
  if ~isfield(params,'ls_max_iter'),
    params.ls_max_iter = 10;
  end
  
  % Maximum number of iterations
  if ~isfield(params,'max_iter'),
    params.max_iter = 10000;
  end
  
  % Minimum number of iterations
  if ~isfield(params,'min_iter'),
    params.min_iter = 3;
  end
  
  if ~isfield(params,'compute_predictions'),
    params.compute_predictions = 0;
  end
  

end